package com.etc.exec;

public class Pet {
    private String name;
    public void play(Pet pet){
        if(pet instanceof Dog){
            System.out.println(getName()+"鍜屼富浜虹帺椋炵洏娓告垙锛屽仴搴峰�煎噺灏�10锛屼笌涓讳汉浜插瘑搴﹀姞5");
        }else if(pet instanceof Penguin){
            System.out.println(getName()+"鍜屼富浜虹帺娓告吵娓告垙锛屽仴搴峰�煎噺灏�10锛屼笌涓讳汉浜插瘑搴﹀姞5");
        }
    }

    public Pet() {
    }

    public Pet(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
